require.config({
    baseUrl: "../js",
    name: "main",
    out: "../js/main-built.js",
    generateSourceMaps: true,
    preserveLicenseComments: false,
    optimize: "uglify2",
    paths: {
        css: '../js/requirejs/css',
        'css-builder': '../js/requirejs/css-builder',
        normalize: '../js/requirejs/normalize',
        text: '../js/requirejs/text',
        html: '../js/requirejs/html'
    }
});
require(['../component/TextListA','template', 'key-control', 'TV', 'Component', 'css!../css/a.css', 'html!../template/test.html'], function () {
    var template = require('template');
    var TV = require('TV');
    var Component = require('Component');
    var nodes = document.querySelectorAll('.item')
    for (var i = 0; i < nodes.length; i++) {
        nodes[i].id = 'item' + (i + 1);
    }
    for (var i = 0; i < nodes.length; i++) {
        var c = new Component(nodes[i].id);
        c.nextFocusRight = nodes[i + 1] ? nodes[i + 1].id : '';
        c.nextFocusLeft = nodes[i - 1] ? nodes[i - 1].id : '';
        c.nextFocusUp = nodes[i - 5] ? nodes[i - 5].id : '';
        c.nextFocusDown = nodes[i + 5] ? nodes[i + 5].id : '';
        TV.use(c)
    }
    // var i = 1;
    // setInterval(function () {
    //     if (i > nodes.length) i = 1;
    //     TV.moveToNextFocus('item' + i);
    //     i++;
    // }, 200);
    console.log(TV.components);
    var TextListA = require('../component/TextListA');
    var test = require('html!../template/test.html');
    var content = template.render(test, {
        msg: 'Hello word!',
        list: [{key: 'key1', value: 'value1'}, {key: 'key2', value: 'value2'}]
    })


    // console.log(content)
});
